Developer Documentation

QuickTime 4 API Documentation

Programming With QuickTime VR

| Previous | Chapter Contents | Chapter Top | Next |

Determining That the QuickTime VR Manager Is Available

Before calling any QuickTime VR Manager routines, you need to verify that the QuickTime VR Manager is available in the current operating environment and that it has the capabilities you need. For the Mac OS, you can verify that the QuickTime VR Manager is available by calling the Gestalt function with the gestaltQTVRMgrAttr selector. Gestalt returns, in its second parameter, a long word whose value encodes the attributes of the QuickTime VR Manager. Listing 2-1 illustrates how to determine whether the QuickTime VR Manager is available.

Listing 1 Checking for the availability of the QuickTime VR Manager

Boolean MyHasQTVRManager (void)
{
    OSErr           myErr;
    long            myAttrs;
    Boolean         myHasQTVRMgr = false;
    
    myErr = Gestalt(gestaltQTVRMgrAttr, &myAttrs);
    if (myErr == noErr)
        if (myAttrs & (1 << gestaltQTVRMgrPresent))
            myHasQTVRMgr = true;

    return myHasQTVRMgr;
}

You can also use the Gestalt function to get information about other attributes of the QuickTime VR Manager. See "Gestalt Selector and Response Values" for details on the QuickTime VR Manager attributes you can query.

The Gestalt function is available with all operating systems. On those systems that require a call to InitializeQTML , Gestalt is available after calling InitializeQTML . On those systems, calling InitializeQTVR is still required after calling Gestalt , and the value returned from InitializeQTVR must be checked even when the call to Gestalt is successful, so the call to Gestalt is not necessary, but it can be useful in determining the version and features of the QuickTime VR software that is installed.


© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |